package com.edu.bean;

import org.springframework.beans.factory.BeanNameAware;

import java.io.Serializable;

public class User{

    private int userId;

    private int age;

    public String username;

    public String sex;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public void sayHi(){
        System.out.println("hello world");
    }

    public void sayHi(String str) throws NullPointerException,ClassNotFoundException{
        System.out.println("你好，我是"+this.username+str);
    }

    public void sayHi(int num){
        System.out.println("你好数字是"+num);
    }

    public double getNum(){
        return Math.random()*100;
    }

    private void innerMethod(){
        System.out.println("该方法只可在 内的内部使用");
    }

    public User() {
    }


    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", age=" + age +
                ", username='" + username + '\'' +
                ", sex='" + sex + '\'' +
                '}';
    }
}
